package org.lw.proxy.config;

import org.lw.proxy.myproxy.MyLoggingProxyFactory;
import org.lw.proxy.service.Caculator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@ComponentScan("org.lw.proxy")
public class SpringConfig {
    @Bean
    public Caculator caculatorLogProxy( Caculator caculator){
        return (Caculator) MyLoggingProxyFactory.createProxy(caculator);
    }

}
